-
Notifications
You must be signed in to change notification settings - Fork 173
[TF-27883] Add agent execution mode and pool to test config #1832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hashimoon
wants to merge
13
commits into
main
Choose a base branch
from
hashiomoon/TF-27883-agent-pool
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
01cc650
to
155e0ca
Compare
155e0ca
to
0cab058
Compare
f45ef43
to
4217cce
Compare
Introduces 'agent_execution_mode' and 'agent_pool_id' fields to the registry module test_config schema, supporting both agent and remote execution modes. Adds validation to prevent agent_pool_id from being set when execution mode is 'remote', updates create, update, and read logic, and provides comprehensive acceptance tests for new behaviors. Also updates dependencies to latest versions.
0a7ac4f
to
92e9804
Compare
Changed test config handling to always initialize RegistryModuleTestConfigOptions when testConfig is not nil, and set TestsEnabled only if present. This improves robustness and prevents potential nil pointer issues.
Increased the test matrix from 1 to 8 parallel jobs for improved CI performance. Updated the report merging step to include all new test summary directories.
Adds cache-dependency-path to Go setup steps for improved caching and renames lint step for clarity. Updates test action to run tests in parallel and removes 'go mod tidy' from dependency sync.
Removes the empty string check and ensures agent_execution_mode is always set when AgentExecutionMode is not nil, converting its value to a string.
Introduces debug log statements to trace the values of agent_execution_mode and agent_pool_id during creation and reading of TFE registry modules. This aids in troubleshooting and verifying correct configuration handling.
Adds logic to update the registry module's test_config with agent_execution_mode after creation, since the API does not accept agent_execution_mode during initial creation. The update is performed if agent_execution_mode is specified in the test_config.
Eliminates post-creation update logic for agent_execution_mode in test_config, as the API does not accept this field during creation. Now, agent_execution_mode is set to 'agent' during read when agent_pool_id is present.
Eliminated various log.Printf debug statements from resourceTFERegistryModuleCreateWithVCS and resourceTFERegistryModuleRead to clean up output and improve code clarity.
Adds 'agent_execution_mode' with value 'agent' to testConfigValues when 'agent_pool_id' is set, ensuring correct execution mode is specified for registry module tests.
Eliminated the call to skipIfEnterprise in TestAccTFERegistryModule_agentExecutionModeWithAgentPool, allowing the test to run in all environments.
Modified the test to verify that the 'test_config.0.tests_enabled' attribute is not present instead of 'test_config.0'. This provides a more precise check for the absence of the tests_enabled field in the resource.
Removes redundant override of agent_execution_mode when agent_pool_id is set and ensures agent_execution_mode uses the original value from TestConfig. This prevents unintended value changes in the test configuration.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Introduces 'agent_execution_mode' and 'agent_pool_id' fields to the registry module test_config schema, supporting both agent and remote execution modes. Adds validation to prevent agent_pool_id from being set when execution mode is 'remote', updates create, update, and read logic, and provides comprehensive acceptance tests for new behaviors. Also updates dependencies to latest versions.
Remember to:
Testing plan
- Apply the first Terraform config above
- Verify in TFE/TFC UI that the module's test configuration shows agent execution mode
- Verify the specified agent pool is being used
- Start with a module using remote execution
- Update the configuration to use agent execution mode with an agent pool
- Run terraform apply and verify the change is applied successfully
- Start with a module using agent execution mode
- Change agent_execution_mode back to "remote" and remove agent_pool_id
- Verify the module reverts to remote execution
- Attempt to set agent_pool_id without setting agent_execution_mode = "agent"
- Verify that Terraform returns the appropriate validation error
External links
Include any links here that might be helpful for people reviewing your PR. If there are none, feel free to delete this section.
Output from acceptance tests
Please run applicable acceptance tests locally and include the output here. See testing.md to learn how to run acceptance tests.
If you are an external contributor, your contribution(s) will first be reviewed before running them against the project's CI pipeline.
Rollback Plan
Changes to Security Controls